package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.EvaluationItems;
import com.ruoyi.system.mapper.EvaluationItemsMapper;
import com.ruoyi.system.service.IEvaluationItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 评分项配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-12
 */
@Service
public class EvaluationItemsServiceImpl implements IEvaluationItemsService 
{
    @Autowired
    private EvaluationItemsMapper evaluationItemsMapper;

    /**
     * 查询评分项配置
     * 
     * @param itemId 评分项配置主键
     * @return 评分项配置
     */
    @Override
    public EvaluationItems selectEvaluationItemsByItemId(Long itemId)
    {
        return evaluationItemsMapper.selectEvaluationItemsByItemId(itemId);
    }

    /**
     * 查询评分项配置列表
     * 
     * @param evaluationItems 评分项配置
     * @return 评分项配置
     */
    @Override
    public List<EvaluationItems> selectEvaluationItemsList(EvaluationItems evaluationItems)
    {
        return evaluationItemsMapper.selectEvaluationItemsList(evaluationItems);
    }

    /**
     * 新增评分项配置
     * 
     * @param evaluationItems 评分项配置
     * @return 结果
     */
    @Override
    public int insertEvaluationItems(EvaluationItems evaluationItems)
    {
        return evaluationItemsMapper.insertEvaluationItems(evaluationItems);
    }

    /**
     * 修改评分项配置
     * 
     * @param evaluationItems 评分项配置
     * @return 结果
     */
    @Override
    public int updateEvaluationItems(EvaluationItems evaluationItems)
    {
        evaluationItems.setUpdateTime(DateUtils.getNowDate());
        return evaluationItemsMapper.updateEvaluationItems(evaluationItems);
    }

    /**
     * 批量删除评分项配置
     * 
     * @param itemIds 需要删除的评分项配置主键
     * @return 结果
     */
    @Override
    public int deleteEvaluationItemsByItemIds(String itemIds)
    {
        return evaluationItemsMapper.deleteEvaluationItemsByItemIds(Convert.toStrArray(itemIds));
    }

    /**
     * 删除评分项配置信息
     * 
     * @param itemId 评分项配置主键
     * @return 结果
     */
    @Override
    public int deleteEvaluationItemsByItemId(Long itemId)
    {
        return evaluationItemsMapper.deleteEvaluationItemsByItemId(itemId);
    }
}
